#include <iostream>
#include <cmath> 
#include <stdlib.h>
using namespace std; 


static int isPrime(unsigned int num)
{
	int prime = 1; 
	for(unsigned int i=3; i <= sqrt(num); i+=2)
	{
		if(num%i == 0)
			return 0; 
	}
	return prime; 
}


int main(int argc, char* argv[])
{
	unsigned int currentNum; 
	if(argc <= 1)
		currentNum = 0xFFFFFFFE; 
	else
	{
		currentNum = atoi(argv[1]); 
		currentNum = currentNum/2 + 1; 
	}

	while(1)
	{
		if(isPrime(currentNum))
		{
			cout << currentNum << endl; 
		}
		currentNum += 2; 
	}
}

